const { defineConfig } = require('@vue/cli-service')
const path = require('path')
const resolve = dir => path.join(__dirname, dir)
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8888,  //vue项目访问端口
      proxy: {
        "/api": { // 1
          target: 'http://127.0.0.1:8080',   // 2
          changeOrigin: true, // 3
          pathRewrite: {
            '^/api': '/' // 4
          }
        }
      }
    },
    configureWebpack: {
      // provide the app's title in webpack's name field, so that
      // it can be accessed in index.html to inject the correct title.
      resolve: {
          alias: {
              // 设置@/的意义
              '@': resolve('src')
          }
      }
  }
  
})
